package com.example.experiment4

data class PlayerInfo(
    var name: String = "",
    var gender: Gender = Gender.UNKNOWN,
    var phone: String = "",
    var bestScore: Int = 0
)

enum class Gender { MALE, FEMALE, UNKNOWN }

object PlayerRepository {
    private val playerInfo: PlayerInfo = PlayerInfo()

    fun getInfo(): PlayerInfo = playerInfo

    fun update(name: String, gender: Gender, phone: String) {
        playerInfo.name = name
        playerInfo.gender = gender
        playerInfo.phone = phone
    }

    fun updateBestScore(score: Int) {
        if (score > playerInfo.bestScore) {
            playerInfo.bestScore = score
        }
    }
}


